package com.bonc.situation.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.bonc.situation.vo.TestHBaseBean;

/** 
* @Author guxf
* @Time 2020年12月26日 上午9:59:41 
* @Version 1.0
* <p>Description:</p>
*/
@Repository
public class TestDao {
	@Autowired
	private JdbcTemplate hiveJdbcTemplate; 
	public Object getByName(String id) {
		String sql="select * from test_table where id="+id;
		Map<String, Object> queryForMap = hiveJdbcTemplate.queryForMap(sql);
		return queryForMap;
	}
	public TestHBaseBean getById(String id) {
		String sql="select * from test_table where id="+id;
		return hiveJdbcTemplate.queryForObject(sql, TestHBaseBean.class);
	}
	
	public List<TestHBaseBean> getList(String name){
		String sql="select * from test_table where name="+name;
		return hiveJdbcTemplate.queryForList(sql, TestHBaseBean.class);
	}
}
